<?php 
	include '../ini.php';
	include '../includes/function.php';
	include '../libraries/xl_san_pham.php';
	$dt_xl_san_pham=new xl_san_pham;
	
	include '../libraries/xl_loai_san_pham.php';
	$dt_xl_loai_san_pham=new xl_loai_san_pham;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
<head>
<?php include '../widgets/head.php'?>
<script type="text/javascript" src="../js/jquery/external/jquery.simplyscroll-1.0.4/jquery.simplyscroll-1.0.4.min.js"></script>
<link rel="stylesheet" href="../js/jquery/external/jquery.simplyscroll-1.0.4/jquery.simplyscroll-1.0.4.css" media="all" type="text/css">
<script type="text/javascript" src="../js/jquery/external/stickytooltip/stickytooltip.js"></script>
<link rel="stylesheet" type="text/css" href="../js/jquery/external/stickytooltip/stickytooltip.css" />
</head>
<body>
<?php include '../widgets/header.php'?>
<div id="art-page-background-glare">
  <div id="art-page-background-glare-image">
    <div id="art-main">
      <div class="art-sheet">
        <div class="art-sheet-tl"></div>
        <div class="art-sheet-tr"></div>
        <div class="art-sheet-bl"></div>
        <div class="art-sheet-br"></div>
        <div class="art-sheet-tc"></div>
        <div class="art-sheet-bc"></div>
        <div class="art-sheet-cl"></div>
        <div class="art-sheet-cr"></div>
        <div class="art-sheet-cc"></div>
        <div class="art-sheet-body">
          <?php include '../widgets/nav.php'?>
          <div class="art-content-layout">
            <div class="art-content-layout-row">
              <div class="art-layout-cell art-sidebar1">
                <?php sidebar('left');?>
                <div class="cleared"></div>
              </div>
              <div class="art-layout-cell art-content">
                <div class="art-post">
                  <div class="art-post-tl"></div>
                  <div class="art-post-tr"></div>
                  <div class="art-post-bl"></div>
                  <div class="art-post-br"></div>
                  <div class="art-post-tc"></div>
                  <div class="art-post-bc"></div>
                  <div class="art-post-cl"></div>
                  <div class="art-post-cr"></div>
                  <div class="art-post-cc"></div>
                  <div class="art-post-body">
                    <div class="art-post-inner art-article">
                      <?php thong_bao();?>
                      <h2 class="art-postheader">Sản phẩm xem nhiều</h2>
                      <div class="line"> </div>
                      <div class="art-postcontent">
                        <?php
							$ds_san_pham_xem_nhieu=$dt_xl_san_pham->danh_sach_xem_nhieu();
							foreach($ds_san_pham_xem_nhieu as $san_pham_xem_nhieu)
							{
						  ?>
                        <form method="post" action="../gio-hang/them.html">
                          <input type="hidden" name="ma" value="<?php echo $san_pham_xem_nhieu['ma']?>"/>
                          <div id="sachmoi" class="san_pham" data-tooltip="sticky<?php echo $san_pham_xem_nhieu['ma']?>"> <a class="ten" href="../chi-tiet-sach/<?php echo convert_vi_to_en($san_pham_xem_nhieu['ten']).'-'.$san_pham_xem_nhieu['ma']?>.html"><?php echo cat_chuoi($san_pham_xem_nhieu['ten']);?><img class="hinh" src="../upload/products/<?php echo $san_pham_xem_nhieu['hinh']?>" /></a>
                            <div class="tool">
                              <div>Giá bán: <?php echo number_format($san_pham_xem_nhieu['don_gia'],0,'.',',')?> VNĐ</div>
                              <input class="soluong" type="text" name="so_luong" value="1" />
                              <span class="art-button-wrapper"> <span class="art-button-l"> </span> <span class="art-button-r"> </span>
                              <input type="submit" name="mua_ngay" class="art-button" value="Mua ngay" />
                              </span> </div>
                          </div>
                        </form>
                        <?php
							}
						  ?>
                        <!--HTML for the tooltips-->
                        <div id="mystickytooltip" class="stickytooltip">
                          <div style="padding:5px">
                            <?php						  	
							foreach($ds_san_pham_xem_nhieu as $san_pham_xem_nhieu)
							{
						  ?>
                            <div id="sticky<?php echo $san_pham_xem_nhieu['ma']?>" class="atip">
                              <div class="art-postcontent">
                                <table border="1" class="chitiet">
                                  <tr>
                                    <td colspan="2" class="ten_ct"><?php echo $san_pham_xem_nhieu['ten']?></td>
                                  </tr>
                                  <tr>
                                    <td class="hinh_ct"><img src="../upload/products/<?php echo $san_pham_xem_nhieu['hinh']?>" /></td>
                                    <td class="noidung"><p><strong>Giá bán: </strong><?php echo number_format($san_pham_xem_nhieu['don_gia'],0,'.',',')?> VNĐ</p>
                                      <p><strong>Tác giả :</strong><?php echo $san_pham_xem_nhieu['tac_gia']?></p>
                                      <p><strong>Nhà Xuất Bản :</strong><?php echo $san_pham_xem_nhieu['nha_xuat_ban']?></p>
                                      <p><strong>Tình trạng :</strong>
                                        <?php if($san_pham_xem_nhieu['ma']==1) echo 'Còn hàng'; else echo 'Hết hàng';?>
                                      </p>
                                  </tr>
                                </table>
                              </div>
                            </div>
                            <?php
							}
						  ?>
                          </div>
                          <div class="stickystatus"></div>
                        </div>
                      </div>
                      <div class="cleared"></div>
                    </div>
                    <div class="cleared"></div>
                  </div>
                </div>
                <div class="cleared"></div>
              </div>
              <div class="art-layout-cell art-sidebar2">
                <?php sidebar('right')?>
                <div class="cleared"></div>
              </div>
            </div>
          </div>
          <div class="cleared"></div>
          <?php include '../widgets/footer.php'?>
          <div class="cleared"></div>
        </div>
      </div>
      <div class="cleared"></div>
    </div>
  </div>
</div>
</body>
</html>
